#!C:\WebServer\Python2.4\python.exe

print "Content-Type: text/html\n\n"
print """
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
	<head>
		<title>CDAL Results</title>
		<style type="text/css">
			body {
				font-family: Verdana, Tahoma, Sans-serif;
				font-size: 10pt;
			 	margin-top: 0;
			 	margin-left: 0;
			}
			
			div.title {
			 	float:right;
				font-weight:bold;
				margin-top: 18px;
				clear: left;
				padding-right: 20px;
				color:#FFFFFF;
				background-color: #39638B
			}
			
			#banner {
			 	margin-top: 0;
			 	margin-left: 0;
			 	background-image: url('/cdal/images/top_banner_in02.gif');
			 	background-position: 227px;
				background-repeat: no-repeat;
				background-color:#39638B; 
			}
			
			#title {
			 	font-family: Arial, Tahoma, Sans-serif;
			 	margin-top: 10px;
			 	margin-left: 5px;
			 	margin-bottom: 10px;
			 	font-weight: bold;
			 	font-size: 12pt;
			}
			
			#cdal {
				margin-left: 5px;
			}
			
			#cdal_title, #results_title {
				font-weight: bold;
				color: navy;
			}
			
			#cdal_content {
			 	margin-top: 5px;
			 	width: 600px;
			 	font-family: "courier new", mono;
			 	border-style: solid;
			 	border-width: 1px;
			 	border-color: grey;
			}
			
			#results {
			 	margin-left: 5px;
			 	margin-top: 5px;
			}
			
			div.stat_answer_required, div.ref_answer_required {
			 
			}
		
			div.stat_answer_content {
			 	font-size: 8pt;
			 	font-weight: normal;
			 	color: red;
			}
	
			table {
			 	border-collapse: collapse;
			}
			
			div.stat_answer_required, div.ref_answer_required {
			 	margin-top: 5px;
			}
			
			div.ref_answer_content {
			 	margin-top: 5px;
			 	text-align: center;
			}
			
			div.generate_csv_file {
			 	margin-top: 5px;
			 	text-align: left;
			}
			
			#errors, #db_error, #answers_error, #global_time_period_error, #global_location_error, #demo_criterias_error, #prev_diag_error, #curr_diag_error, #med_criterias_error, #cdal_error {
			 	font-size: 8pt;
			 	font-weight: normal;
			 	color: red;
			}
		</style>
	</head>
	
	<body>
		<div id='banner'>
			<div class='title'>
				Clinical Data Mining Project Group
			</div>
		  	<div> 
				<a href='http://www.usyd.edu.au'>
					 <img src='/cdal/images/top_banner_in01.gif' width='227' height='52' alt='The University of Sydney' style='border: 0px;' class='decor' /> 
				</a>
			</div>
		</div>
		<div id='title'>
			CDAL Results
		</div>
		
		<div id='cdal'>
			<div id='cdal_title'>CDAL entered</div>
			<div id='cdal_content'>
				USING SNOMED, <br/>
				IN GICU, <br/>
				FIND Mean of Heart Rate AND all values of heart rate FOR PATIENTS, <br/>
				WHOSE Age > 60, <br/>
				HAVE PREVIOUS DIAGNOSIS OF pneumonia, <br/>
				HAVE CURRENT DIAGNOSIS OF pneumonia, <br/>
				WITH Heart rate > 140,<br/>
				AFTER 6 hours ago,<br/>
				IN GICU
			</div>
		</div>
		
		<div id='results'>
			<div id='results_title'>Results (Retrieved at 30-Sep-2007 23:40)</div>
			<div class='stat_answer_required'><i>Mean of Heart Rate:</i></div>
			<div class='stat_answer_content'>
				115.39
			</div>
			
			<div class='ref_answer_required'><i>All values of Heart Rate:</i></div>
			<div class='ref_answer_content'>
				<table border='1'>
					<tr><th>Patient ID</th><th>Sep-30-2007 18:00</th><th>Sep-30-2007 19:00</th><th>Sep-30-2007 20:00</th><th>Sep-30-2007 21:00</th><th>Sep-30-2007 22:00</th><th>Sep-30-2007 23:00</th>
					<tr><td>10000001</td><td style='color:red'>141</td><td style='color:red'>140</td><td style='color:red'>141</td><td style='color:red'>142</td><td style='color:red'>140</td><td style='color:red'>137</td></tr>
					<tr><td>10000002</td><td style='color:red'>121</td><td style='color:red'>120</td><td style='color:red'>121</td><td style='color:red'>122</td><td style='color:red'>120</td><td style='color:red'>121</td></tr>
					<tr><td>10000003</td><td style='color:red'>81</td><td style='color:red'>90</td><td style='color:red'>81</td><td style='color:red'>92</td><td style='color:red'>80</td><td style='color:red'>87</td></tr>
				</table>
				<div class='generate_csv_file'><button>Generate comma delimered file (.csv)</button></div>
			</div>
		</div>
	</body>
</html>
""" % locals()
